import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# 读取Excel文件
df = pd.read_excel('fas_count.xlsx', header=0)
# 设置英文和数字的字体为 Times New Roman
plt.rcParams['font.family'] = 'Times New Roman'
# 密度图
plt.figure(figsize=(10, 6))
sns.kdeplot(df['直系同源基因数量'], fill=True, color='skyblue')
plt.title('Density map of gene number distribution', fontsize=16)
plt.xlabel('Number of orthologous genes', fontsize=14)
plt.ylabel('Densities', fontsize=14)
plt.grid(True, linestyle='--', alpha=0.7)
plt.show()